/**
 * Copyright ® 2016 华夏快线 版权所有
 *
 * @Title: PassengerTypeServiceImpl.java
 * @Package com.hxexp.weixin.mvc.common.service.impl
 * @author li.jiang
 * @date 2016年9月22日 下午2:45:54
 * @version 1.0
 */
package com.hxexp.weixin.mvc.common.service.impl;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.hxexp.weixin.mvc.common.service.PassengerTypeService;

/**
 * 乘客类别服务实现类
 *
 * @author li.jiang
 *
 */
@Service
public final class PassengerTypeServiceImpl implements PassengerTypeService {
    @Value("${ticket_type_child}")
    private String childTypeStartStationIds; // 支持儿童类型乘客的车站编码
    @Value("${ticket_type_disabled}")
    private String specialTypeStartStatonIds; // 支持军残类型乘客的车站编码
    /* (non-Javadoc)
     * @see com.hxexp.weixin.mvc.common.service.PassengerTypeService#isChild(java.lang.String)
     */
    @Override
    public boolean isSupportChild(String startStationId) {
        List<String> childTypeStartStationIdList = Arrays.asList(childTypeStartStationIds.split(","));
        return childTypeStartStationIdList.contains(startStationId);
    }

    /* (non-Javadoc)
     * @see com.hxexp.weixin.mvc.common.service.PassengerTypeService#isSpecial(java.lang.String)
     */
    @Override
    public boolean isSupportSpecial(String startStationId) {
        List<String> specialTypeStartStatonIdList = Arrays.asList(specialTypeStartStatonIds.split(","));
        return specialTypeStartStatonIdList.contains(startStationId);
    }

}
